//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_keydowncommandingmenu.sqf"
#include "x_setup.sqf"

private ["_type"];
PARAMS_1(_type);
__TRACE_1("","_type");
if (dialog) exitWith {
	showCommandingMenu "";
};
if (_type == 0 && {!GVAR(DomCommandingMenuBlocked)} && {!GVAR(commandingMenuIniting)}) exitWith {
	GVAR(DomCommandingMenuBlocked) = true;
	if (commandingMenu != "#USER:d_DomUserMenu") then {
		call FUNC(CreateDomUserMenu);
		showCommandingMenu "#USER:d_DomUserMenu";
	};
};
if (_type == 1) then {
	GVAR(DomUserMenu) = [];
};
if (_type == 1 && {GVAR(DomCommandingMenuBlocked)} && {!GVAR(commandingMenuIniting)}) exitWith {
	GVAR(DomCommandingMenuBlocked) = false;
	if (commandingMenu == "#USER:d_DomUserMenu") then {
		showCommandingMenu "";
	};
};